<?php $this->headLink()->appendStylesheet($this->baseUrl('css/adminpage.css'))?>
<?php $this->headLink()->appendStylesheet($this->baseUrl('css/admintable.css')); ?>
<?php echo $this->render('frontend_common/header.phtml'); ?>

<div id="Content">
<div style="margin-left: 20px">
<div id="flower_tool" style="margin: 30px;margin-left: 0">
	<a style="border: 1px solid red; background-color: white; border-radius:5px 5px 5px; padding:5px ;font-weight: bold;color: black;text-decoration: none " href="<?php echo $this->url(array('controller'=>'admin','action'=>'addnewsforacategory','loai_id'=>$this->detailcategorynewid)) ?>">Thêm bài viết mới</a>
</div>

<table style="width: 100%; margin-top: 20px">
	<tr>
		<thead>
		<th>ID</th>
		<th>Hình ảnh</th>
		<th width="150px">Tiêu đề</th>
		<th width="250px">Nội dung</th>
		<th>Trạng thái</th>
		<th style="width: 100px">Tên file ảnh</th>
		<th></th>
		</thead>
	</tr>
<?php foreach ($this->detailcategorynew as $key=>$motbaiviet) 
	{
	?>
	<tr
	<?php
			if ($key % 2 != 0)
				echo ('class="changecolor1" style="background-color:#f3f3f3;"');
			else
				echo ('class="changecolor2" style="background-color:#FFF;"');
		?>
	>
		<td><?php echo $motbaiviet['id']?></td>
		<td>
			<a href="<?php echo $this->baseUrl("images/bottom/".$motbaiviet['img_name']);?>" rel="lightbox">
				<img style="widht:60px; height:60px;" src="<?php echo $this->baseUrl('/images/bottom/').$motbaiviet['img_name'] ?>">
			</a>
		</td>
		<td><?php echo $motbaiviet['tieude'] ?></td>
		<td><?php echo $motbaiviet['noidung'] ?></td>
		<td><?php if($motbaiviet['acti'])
						echo "Đang được đăng";
					else
						echo "Không được đăng";
			?></td>
		<td><?php echo $motbaiviet['img_name'] ?></td>
		<td class="command">
			
			<?php 
				if($motbaiviet['acti']==0) {?>
				<a href="<?php echo $this->url(array('controller'=>'admin','action'=>'setacti','id_bv'=>$motbaiviet['id'],'loai_id'=>$motbaiviet['loaibaiviet_id'])) ?>">
					<img title="Đăng bài" src="<?php echo $this->baseUrl().'/images/system/up-btn.png' ?>" />
				</a>
			<?php } else { ?>
				<a href="<?php echo $this->url(array('controller'=>'admin','action'=>'setacti','id_bv'=>$motbaiviet['id'],'loai_id'=>$motbaiviet['loaibaiviet_id'])) ?>">
					<img title="Bỏ đăng bài" src="<?php echo $this->baseUrl().'/images/system/down-btn.png' ?>" />
				</a>
			<?php }
			?>
			<a href="<?php echo $this->baseUrl('admin/editbaiviet/id_bv/').$motbaiviet['id'] ?>">
				<img title="Sửa thông tin" class="tool_img" src="<?php echo $this->baseUrl("images/system/changeicon.png") ?>" />
			</a>
			<a href="<?php echo $this->url(array('controller'=>'admin','action'=>'deletebaiviet','id_bv'=>$motbaiviet['id'])) ?>"> 
				<img title="Xóa" class="tool_img" src="<?php echo $this->baseUrl("images/system/deleteicon.jpg") ?>" />
			</a>
		</td>
	</tr>
<?php 
	}
?>
</table>
<a style="border: 1px solid red; background-color: white; border-radius:5px 5px 5px; padding:5px ;font-weight: bold;color: black;text-decoration: none; margin-top: 30px; float: left;margin-bottom: 30px " href="<?php echo $this->baseUrl('admin/categorynewmanager') ?>">Trang quản lí tin tức</a>
<?php echo $this->render('frontend_common/footer.phtml'); ?>